﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows.Media;
using System.Windows;
using System.Windows.Documents;
using System.Windows.Controls;

namespace Pavilion.DesignerTool
{
    public class ConnectionCreator
    {
        public Anchor TryCreatingConnection(Visual reference, Point location, Anchor start)
        {
            //Anchor anchor = null;
            //var adornedElement = reference as UIElement;

            //VisualTreeHelper.HitTest(reference, null,
            //    hitTestParameters: new PointHitTestParameters(location),
            //    resultCallback: (HitTestResult result) =>
            //    {
            //        anchor = PavilionVisualTreeHelper.GetAncestor(result.VisualHit, typeof(Anchor)) as Anchor;
            //        if (anchor != null)
            //            AdornerLayer.GetAdornerLayer(reference).Add(new Connection(oldValue, anchor));

            //        return HitTestResultBehavior.Stop;
            //    });
            //return anchor;

            return null;
        }
    }
}
